package com.study.cloud.apilog;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class GatewayLogListener implements ApplicationListener<GatewayLogEvent> {

//    @Autowired
//    private RocketMQProducter rocketMQProducter;

    @Override
    public void onApplicationEvent(GatewayLogEvent gatewayLogEvent) {
        GatewayApiLog gatewayLog = gatewayLogEvent.getGatewayLog();

        log.info("网关日志: "+gatewayLog.toString());

//        rocketMQProducter.synchGatewayLog(gatewayLog);
    }
}
